Calling .return() on a generator will execute any pending finally block before terminating the generator, allowing cleanup operations to run.
.return()
finally